package com.yycx.module.bus.provider.service.hy;

import com.yycx.module.bus.client.entity.hy.BusPaymentOrder;
import com.yycx.common.mybatis.base.service.IBaseService;

import java.math.BigDecimal;
import java.util.List;

/**
 * 认款使用记录 接口
 *
 * @author flyme
 * @date 2023-11-04
 */
public interface BusPaymentOrderService extends IBaseService<BusPaymentOrder> {

    /**
     * 根据订单ID和认款查询
     *
     * @param orderId
     * @param paymentId
     * @return
     */
    BusPaymentOrder findByPaymentIdAndOrderId(String orderId, Long paymentId);

    /**
     * 统计已用金额
     *
     * @param paymentId
     * @return
     */
    BigDecimal totalByPaymentId(Long paymentId);

    /**
     * 根据订单ID删除
     *
     * @param orderId
     * @return
     */
    Boolean removeByOrderId(String orderId);

    /**
     * 查询订单认款使用记录
     * @param orderId
     * @return
     */
    List<BusPaymentOrder> selectByOrderId(String orderId);

    /**
     * 查询订单认款使用记录
     * @param orderId
     * @return
     */
    List<BusPaymentOrder> selectByOrderIdOrderByAmountAsc(String orderId);
}
